<%-- 
  - Author: Abed Yaseen
  - Date: 02-Jan-2012
  - Copyright Notice: TRAKHEES
  - Description: AttachmentsTab.jsp
 --%>
 <%@ page import="ae.pcfc.etks.cld.to.web.Constants" %>
 <%@ include file="/WEB-INF/view/include.jsp"%>
 
 <!-- Attachments -->
        <div id="Attachments">
        	<fieldset>
			 	<legend><spring:message code="header.attachments" /></legend>
			</fieldset>
			<div class="t_form_middle">
				<%--<label for="PassportCopy" class="frm-req"><spring:message code="label.passport_copy" /></label>
				<input type="file" id="PassportCopy" name="PassportCopy"  />
				
				<label for="LetterFromCompany" class="frm-req"><spring:message code="label.letter_from_company" /></label>
				<input type="file" id="LetterFromCompany" name="LetterFromCompany"  />
				
				<label for="Photograph" class="frm-req"><spring:message code="label.photograph" /></label>
				<input type="file" id="Photograph" name="Photograph" />
				
				<label for="InsurancePaper" class="frm-req" id="InsurancePaperLbl"><spring:message code="label.insurance_paper" /></label>
				<input type="file" id="InsurancePaper" name="InsurancePaper" />
				
				<label for="cancellationOrVisitCopy" class="frm-req" id="cancellationOrVisitCopyLbl"><spring:message code="label.cancellation_or_visit_copy" /></label>
				<input type="file" id="cancellationOrVisitCopy" name="cancellationOrVisitCopy"  />
				
				<label for="cancellationPaper" class="frm-req" id="cancellationPaperLbl"><spring:message code="label.cancellation_paper" /></label>
				<input type="file" id="cancellationPaper" name="cancellationPaper"  /> --%>
				
				<c:forEach items="${files}" var="item">
					<c:choose>
					<c:when test="${item.attachmentTypeCode!='10'}">
							<div id="div${item.id }">
											<c:choose>
												 <c:when test="${item.attachmentTypeCode=='1'}">
												 	<label for="passportCopy" ><spring:message code="label.passport_copy" /><span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
					 							 <c:when test="${item.attachmentTypeCode=='2'}">
												 	<label for="letterFromCompany" ><spring:message code="label.letter_from_company" /><span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
					 							 <c:when test="${item.attachmentTypeCode=='3'}">
												 	<label for="photograph" ><spring:message code="label.photograph" /><span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
					 							 <c:when test="${item.attachmentTypeCode=='4'}">
												 	<label for="insurancePaper" ><spring:message code="label.insurance_paper" /><span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
					 							 <c:when test="${item.attachmentTypeCode=='5'}">
												 	<label for="cancellationOrVisitCopy" >
												 		<c:if test="${EmploymentVisaLicenseInfo.employeeSource!=3}">
															<spring:message code="label.cancellation_or_visit_copy" />
														</c:if>
														<c:if test="${EmploymentVisaLicenseInfo.employeeSource ==3}">
															<spring:message code="label.immigration_app" />
														</c:if>
												 	<span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
					 							 <c:when  test="${item.attachmentTypeCode=='6'}">
												 	<label for="cancellationPaper" ><spring:message code="label.cancellation_paper" /><span class="required-field"><spring:message code="label.field.required" /></span></label>
					 							 </c:when>
											</c:choose>
								<input id="input${item.id }" type="text" value="${item.fileName}" disabled="disabled"/>
								<a id="view${item.id }"  class="pdfimageattachment" href="file/${item.id}" title="${item.fileName}" style="width:15px;height:15px;display:inline;"><img alt="View" src="resources/images/common/show_img_icon.jpg" /></a>
								<img id="edit${item.id }" src="resources/images/common/view_icon.jpg" alt="edit" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','show');">
								<c:choose>
									 <c:when test="${item.attachmentTypeCode=='1'}">
										<input type="file" id="PassportCopy" name="passportCopy" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
		 							 <c:when test="${item.attachmentTypeCode=='2'}">
										<input type="file" id="LetterFromCompany" name="letterFromCompany" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
		 							 <c:when test="${item.attachmentTypeCode=='3'}">
										<input type="file" id="Photograph" name="photograph" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
		 							 <c:when test="${item.attachmentTypeCode=='4'}">
										<input type="file" id="InsurancePaper" name="insurancePaper" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
		 							 <c:when test="${item.attachmentTypeCode=='5'}">
										<input type="file" id="cancellationOrVisitCopy" name="cancellationOrVisitCopy" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
		 							 <c:when test="${item.attachmentTypeCode=='6'}">
										<input type="file" id="cancellationPaper" name="cancellationPaper" style="display:none" />
										<img id="remove${item.id }" src="resources/images/common/cancel_icon.jpg" alt="cancel" style="display:none" onclick="editAttachment('${item.id }','${item.attachmentTypeCode}','hide');">
		 							 </c:when>
								</c:choose>
							</div>
							<div  class="t_pop_up">
								<div id="${item.id}">
							
								<img src="file/${item.id}" />
								</div>
							</div>
						</c:when>
					</c:choose>
				</c:forEach>
				
			</div>
			<div id="fm-submit">
				<button  class="button_small" id="Attachments-Next"  ><spring:message code="button.next" /></button>
        		<button  class="button_small" id="Attachments-Prev" ><spring:message code="button.previous" /></button>
			</div>
		</div>